package com.ruoyi.lab.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.lab.domain.JacTestProjectLog;
import com.ruoyi.lab.service.IJacTestProjectLogService;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;

/**
 * log 提供者
 * 
 * @author ruoyi
 * @date 2021-04-06
 */
@RestController
@RequestMapping("projectlog")
public class JacTestProjectLogController extends BaseController
{
	
	@Autowired
	private IJacTestProjectLogService jacTestProjectLogService;
	
	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{id}")
	public Object get(@PathVariable("id") Long id)
	{
		HashMap<String,Object> result=new HashMap<String, Object>();

			result.put("data", jacTestProjectLogService.selectJacTestProjectLogById(id));
			result.put("msg", "success");
			result.put("code", "0");
			return result;

	}
	
	/**
	 * 查询log列表
	 */
	@GetMapping("list")
	public R list(JacTestProjectLog jacTestProjectLog)
	{
		startPage();
        return result(jacTestProjectLogService.selectJacTestProjectLogList(jacTestProjectLog));
	}
	
	
	/**
	 * 新增保存log
	 */
	@PostMapping("save")
	public R addSave(@RequestBody JacTestProjectLog jacTestProjectLog)
	{		
		return toAjax(jacTestProjectLogService.insertJacTestProjectLog(jacTestProjectLog));
	}

	/**
	 * 修改保存log
	 */
	@PostMapping("update")
	public R editSave(@RequestBody JacTestProjectLog jacTestProjectLog)
	{		
		return toAjax(jacTestProjectLogService.updateJacTestProjectLog(jacTestProjectLog));
	}
	
	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{		
		return toAjax(jacTestProjectLogService.deleteJacTestProjectLogByIds(ids));
	}
	
}
